package com.lizhen.core.function.annotation;

public class Annotation {
    public static void main(String[] args) {
        HelloAnnotation.Main(null);
    }

    @interface Version {
        int major();

        int minor();
    }

    @Version(major = 1, minor = 0)
    static class HelloAnnotation {
        @Version(major = 1, minor = 1)
        private int xyz = 110;

        @Version(major = 1, minor = 0)
        public static void Main(String[] args) {
            new HelloAnnotation().Main(new HelloAnnotation().xyz);
            new HelloAnnotation().printData();
        }

        @Version(major = 1, minor = 1)
        public void setXyz(int xyz) {
            @Version(major = 1, minor = 2)
            int newValue = xyz;
            this.xyz = xyz;
        }

        @Version(major = 1, minor = 1)
        public void Main(int xyz) {
            this.xyz = xyz;
        }

        @Version(major = 1, minor = 0)
        public void printData() {
            System.out.println(new HelloAnnotation().xyz);
        }
    }
}
